package org.adultedu.service.serviceimpl;

import org.adultedu.dao.TeacherMapper;
import org.adultedu.pojo.Teacher;
import org.adultedu.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service("TeacherServiceImpl")
public class TeacherServiceImpl implements TeacherService {
    @Autowired
    private TeacherMapper teacherMapper;

    public List<Teacher> queryAllTeacher() {
        return teacherMapper.queryAllTeacher();
    }

    public List<Teacher> queryUniqueTeacher(Teacher teacher) {
        return teacherMapper.queryUniqueTeacher(teacher);
    }

    public List<Teacher> queryLimitTeacher(String tname, String tele, Integer isverify, Integer currentpage, Integer pagesize) {
        return teacherMapper.queryLimitTeacher(tname,tele,isverify,currentpage,pagesize);
    }

    public int updateTeacher(Teacher teacher) {
        return teacherMapper.updateTeacher(teacher);
    }

    public int insertTeacher(Teacher teacher) {
        return teacherMapper.insertTeacher(teacher);
    }

    public int deleteTeacher(String tid) {
        return teacherMapper.deleteTeacher(tid);
    }
}
